package com.example.demo;

import com.example.demo.comm.ThreadPoolComponent;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.concurrent.*;

@SpringBootApplication
@MapperScan(basePackages = "com.example.demo.mapper")
public class DemoApplication {
   public static ExecutorService executorService =  new ThreadPoolComponent().getFullIOExecutorService(5, 60L, TimeUnit.SECONDS, new LinkedBlockingDeque<>(80), new ThreadPoolExecutor.CallerRunsPolicy());

    public static void main(String[] args) throws ExecutionException, InterruptedException, TimeoutException {
        SpringApplication.run(DemoApplication.class, args);

//        //多线程进行分段下载，合并文件
//        MultiPartDownLoadUtils.downLoad("http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4" , "F:\\");
    }

}
